package tr.edu.yildiz.ce.app_manager.ui;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.beans.factory.annotation.Qualifier;

import tr.edu.yildiz.ce.app_manager.service.AppProxyService;
import tr.edu.yildiz.ce.app_manager.service.ServiceProvider;
import tr.edu.yildiz.ce.app_manager.ui.components.main.MainLayout;
import tr.edu.yildiz.ce.app_manager.ui.components.menu.MenuLayout;

import com.vaadin.Application;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Window;

@Configurable(preConstruction = true)
public class AppManagerApplication extends Application {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3655943203886653765L;
	@Autowired
	ServiceProvider serviceProvider;
	
	MenuLayout menuLayout ;
	MainLayout main ;

	@Override
	public void init() {
		Window mainWindow = new Window("App-Manager Application2");
		HorizontalLayout layout = new HorizontalLayout();
		layout.setSizeFull();
		menuLayout = new MenuLayout(this);
		
		Panel panel = new Panel("");
		panel.setSizeUndefined();
		main = new MainLayout(this);
		panel.addComponent(main);

		layout.addComponent(menuLayout);
		layout.addComponent(panel);
		
		mainWindow.addComponent(layout);
		setMainWindow(mainWindow);
	}
	
	public ServiceProvider getServiceProvider() {
		return serviceProvider;
	}
	
	public MainLayout getMainLayout() {
		return main;
	}
	

}
